FIG. 1 is a block diagram illustrating a configuration of a shared memory type computer as an information processing device including nodes as processors of a directory scheme.
The plurality of nodes 10-1 to 10-4 are interconnected by an interconnection network 11. In each of the nodes 10-1 to 10-4, CPU (Central Processing Unit) cores 12-1 to 12-n, which are processing units, are provided. A configuration where a plurality of CPU cores are provided in one node in this way is referred to as a multi-core configuration. The CPU cores 12-1 to 12-n are respectively connected to a data cache 16 via a cache controller 13. Moreover, to the cache controller 13, a directory cache 14, and a memory controller 15 are connected. The cache controller 13 controls accesses that the CPU cores make to the data cache 16 or the directory cache 14. To the memory controller 15, a memory 17 as a main storage device is connected. The memory controller 15 controls accesses that the CPU cores make to the memory 17. In a shared memory type computer of a directory scheme, a memory directory is provided in the memory 17.
In directory information of the memory directory, a cache state where each data of the memory 17 is cached in a different node is recorded. Moreover, in the directory information of the memory directory, identification information of a different node, which indicates a node where data is cached, is stored.
In the directory cache 14, dirty information indicating the possibility that directory information is updated in the directory cache and does not match directory information of a memory directory is held in addition to address information and directory information of the corresponding memory directory. The directory information is composed of status information indicating a cache state where memory data corresponding to the directory information is cached in a different node, and information indicating a node where the memory data is cached. The following description assumes that status information included in directory information are compared when the directory information are compared. The dirty information is set to C (Clean) if directory information of the directory cache matches that of a memory directory, or set to D (Dirty) if the directory information of the directory cache mismatches the directory information of the memory directory. For example, when directory information of data that is not cached in a different node is stored in the directory cache 14, dirty information of the directory information is set to C (Clean). Next, when data is read from the different node to the memory 17 of a local node, dirty information of the corresponding directory information in the directory cache 14 is set to D (Dirty). Thereafter, when the data is written back from the different node to the memory 17 of the local node, the corresponding directory information in the directory cache 14 is restored to a state before the information becomes dirty. However, the dirty information corresponding to the directory information is left unchanged as the D (Dirty) state.
FIG. 2 illustrates a configuration of a conventional directory cache, and that of a memory including a memory directory.
FIG. 2(a) illustrates the directory cache. In the directory cache, a validity flag indicating validity or invalidity of each entry, an address of data corresponding to each entry within the memory, directory information of the data, and dirty information indicating whether or not the directory information of the entry is changed. FIG. 2(a) depicts that the directory cache is configured with a direct map scheme. If an N-way set associative scheme is adopted, the N configurations of FIG. 2(a) are prepared in parallel.
FIG. 2(b) illustrates the memory including the memory directory. In the memory, memory data is stored. At the same time, directory information indicating a cache state where the memory data is held in a data cache of a remote node (different node) is stored. As the directory information, any of L (Local) indicating that data is not held in a data cache of a remote node, REX (Remote EXclusive) indicating that data is exclusively held in a data cache of a remote node, and RSH (Remote SHare) indicating that data is held in a data cache of a remote node and permitted to be shared, and identification information of a node where memory data is cached, are stored. Here, exclusively holding data in a data cache of a remote node means that only the remote node is allowed to access the data.
When an access is made from a CPU core of a home node or a remote node to the memory data of the memory, directory information is updated, and contents of the directory information are written to the directory cache.
The dirty information is updated to D (Dirty) when the directory information is updated even once in the directory cache. Therefore, the dirty information is not restored to C (Clean) even if the directory information of the directory cache and that of the memory directory match.
Unlike data of the data cache, however, the directory information of the directory cache that is once updated is again restored to the former state, which is the same as that of the memory directory, in many cases.
Assume a case where data at a certain address in the memory is not held in a data cache of an arbitrary node and directory information of the memory is not held in the directory cache (normal initial state). At this time, the directory information of the memory directory is L (Local). When a request to reference the memory data is issued from a remote node (another node) different from a home node (local node) of the memory, the memory data is registered to the cache memory of the remote node, and the directory information of the memory directory is registered to the directory cache after being updated from L (Local) to RSH (Remote SHare). Moreover, the dirty information of the directory cache is set to D (Dirty). Thereafter, when the memory data registered to the data cache of the remote node is flushed back or written back to the memory of the home node due to replacement, the directory information of the directory cache is updated from RSH to L. Therefore, the directory information of the directory cache and that of the memory directory are restored to a state where they match. However, since the dirty information of the directory cache is once set to D (Dirty), it is disabled to be restored to C (Clean). Accordingly, directory information that is actually C (Clean) in the memory directory is written back to the memory when the directory information of the directory cache is replaced. The write-back performed when the directory information of the directory cache is replaced results in a write-back of the directory information that should be C (Clean). This is a useless memory access, leading to degradation of a throughput.
Conventional techniques include a technique for respectively attaching a cache TAG to a local node and a remote node in order to enable identification of whether cache data is either data of a local node or that of a remote node.